Skip to content

Enhancement: Replace print() with log() #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 7, 2021
Merged

Conversation

ueman
Copy link
Collaborator

@ueman ueman commented May 4, 2021

📜 Description

💡 Motivation and Context

Fixes #451

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@@ -254,5 +255,10 @@ void noOpLogger(SentryLevel level, String message) {}

/// A Logger that prints out the level and message
void dartLogger(SentryLevel level, String message) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For v6 I'd like to add an error and stacktrace parameter to our loggers.

They can be passed to https://api.flutter.dev/flutter/dart-developer/log.html and look hopefully better

@codecov-commenter
Copy link

codecov-commenter commented May 4, 2021

Codecov Report

Merging #453 (fb88b55) into main (5039731) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #453      +/-   ##
==========================================
+ Coverage   89.98%   90.04%   +0.05%     
==========================================
  Files          54       54              
  Lines        1698     1707       +9     
==========================================
+ Hits         1528     1537       +9     
  Misses        170      170              
Impacted Files Coverage Δ
dart/lib/src/protocol/sentry_level.dart 100.00% <100.00%> (ø)
dart/lib/src/sentry_options.dart 91.30% <100.00%> (+0.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5039731...fb88b55. Read the comment docs.

@ueman
Copy link
Collaborator Author

ueman commented May 4, 2021

Logs look like this now
screenshot

Well without the double brackets around sentry

@ueman ueman marked this pull request as ready for review May 4, 2021 10:54
/// function.
/// These levels are inspired by
/// https://pub.dev/documentation/logging/latest/logging/Level-class.html
int toLogLevel() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we call toDartLogLevel instead?

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ueman ueman merged commit 7fc44a1 into main May 7, 2021
@ueman ueman deleted the fix/do-not-record-sdk-logs branch May 7, 2021 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter out SDK logs from Breadcrumbs
3 participants